/**
* 动作表，index为状态和终结符
*/

#pragma once
#ifndef __ACTIONTABLE__H__
#define __ACTIONTABLE__H__

#include "Table.h"
#include "../lib/Word.h"


namespace compile
{
	class ActionTable : public Table
	{
	public:
		ActionTable();
		ActionTable(vector<Word> word_vector);
		~ActionTable();
		virtual map< pair <string, string>, string> getTable() const override;
		virtual string searchTable(pair<string, string> index) const override;
		virtual void printTable() const override;
		void setTable(pair<string, string> index, string content);
		void initIndex(vector<Word> word_vector);
		set<string> getIndexSet() const;


	private:
		map< pair< string, string >, string > action_table;
		set<string> index_set; // 标记终结符


	};
}
#endif
